﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo._7C
{
    public partial class CikilanToplar : XForm
    {
        public CikilanToplar()
        {
            InitializeComponent();
        }

        private void CikilanToplar_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetGPCikilanToplar");
            gridView1.AddDetailGrid(gridView2, "CikisPartisiId,OrderRef,DosyaNo");
            gridView1.AddColumn("ToplamQty", typeof(decimal), "SUM(Child({FK}).ToplamQty)");
            gridView1.FormatAsNumber(0, "ToplamQty");
            gridView1.AddSummary("ToplamQty");

            gridView2.FormatAsNumber(0, "ToplamQty");
            gridView2.AddSummary("ToplamQty");

            gridView1.MakeReadOnly();
            gridView2.MakeReadOnly();

            gridView1.BestFitColumns();
            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
            gridView1.MoveLast();
            gridView1.Columns["DosyaNo"].Width = 750;
            gridView1.MakeRowVisible(gridView1.FocusedRowHandle);

            splitContainerControl1.AutoSize();
        }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }
    }
}
